#include <memory.h>
#include "ISO8583.h"

namespace suxw
{
    ISO8583::ISO8583()
    {
        memset(m_szISO8583Buf, 0, MAX_BUF_SIZE);
        memset(m_szFieldManager, 0, MAX_FIELD_COUNT * sizeof(int));
        m_bitMap.setBitsCount(128);
    }

    bool ISO8583::parse(unsigned char *pcBuf, int nLen)
    {
        if (nLen > MAX_BUF_SIZE)
        {
            return false;
        }

        memset(m_szISO8583Buf, 0, MAX_BUF_SIZE);
        memcpy(m_szISO8583Buf, pcBuf, nLen);
    }

    //get data element
    bool ISO8583::getDE(int id, unsigned char *pcData, int &pnLen)
    {
        return true;
    }

    //set data element
    bool ISO8583::setDE(int id, unsigned char *pcData, int nLen)
    {
        //for test sta
        BitArray::main(0, 0);
        //for test end

        return true;
    }
}
